home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / propmgr1.arc / POSTIT.ACC < prev    next >
Encoding:
Text File  |  1979-12-31  |  10.3 KB  |  368 lines

  1. * DATE 06/24/84  17:05
  2. * postit.acc - module to update the file
  3. STOR CHR(PEEK(063)) TO dr
  4. SELE PRIMARY
  5. USE &dr.:account
  6. SET INDEX TO &dr.:account
  7. STOR f TO ok
  8. ERAS
  9. STOR 'Y' to comm
  10. @ 10,00 SAY 'Do you want to post the tenant rent payments to the tenant accounts ?'
  11. @ 10,70 GET comm PICTURE '!'
  12. READ
  13. DO WHIL @(comm,'YN') = 0
  14.  @ 10,00 SAY 'Do you want to post the tenant rent payments to the tenant accounts ?'
  15.  @ 10,70 GET comm PICTURE '!'
  16.  READ
  17. ENDD
  18. IF comm = 'Y'
  19.  STOR t TO accrue1
  20. ELSE
  21.  STOR f TO accrue1
  22. ENDI
  23. STOR 'Y' TO comm1
  24. @ 12,10 SAY 'Do you want to post the monthly rent accruals ?'
  25. @ 12,59 GET comm1 PICTURE '!'
  26. READ
  27. DO WHIL @(comm1,'YN') = 0
  28.  @ 12,10 SAY 'Do you want to post the monthly rent accruals ?'
  29.  @ 12,59 GET comm1 PICTURE '!'
  30.  READ
  31. ENDD
  32. IF comm1 = 'Y'
  33.  STOR date() to mdate1
  34.  @ 14,10 SAY 'What is the rent accrual date (MM/DD/YY) ? '
  35.  @ 14,59 GET mdate1 PICTURE '99/99/99'
  36.  READ
  37.  STOR t TO accrue
  38. ELSE
  39.  STOR f TO accrue
  40. ENDI comm1
  41. IF accrue1
  42.  STOR 0 TO latech
  43.  LOCA for $(data,7,3) = '104' .AND. $(data,12,1) = 'T' .AND.(.NOT. posted)
  44.  DO WHIL accrue1
  45.   STOR # TO rec:no
  46.   STOR $(data,13,5) TO name
  47.   STOR $(date,5,2) TO mlate
  48.   STOR amount to mamount
  49.   SELE secondary
  50.   USE &dr.:tenant
  51.   SET index to &dr.:codea
  52.   FIND &name
  53.   IF # <> 0
  54.    STOR trentd TO mtrentd
  55.    STOR trentt TO mtrentt
  56.    STOR trenty TO mtrenty
  57.    STOR tlatec TO mtlatec
  58.    IF VAL(mlate) > VAL(tlate)
  59.     STOR latech + mtlatec TO latech
  60.     STOR mtlatec + mtrentd TO mtrentd
  61.     REPL watchit WITH t
  62.    ENDI VAL(mlate)
  63.    REPL trentd WITH (mtrentd-mamount), trentt WITH (mtrentt+mamount)
  64.    REPL trenty WITH (mtrenty+mamount), posted WITH t, tupdate WITH DATE()
  65.    STOR t TO ok
  66.   ELSE
  67.    STOR f TO ok
  68.   ENDI # <) 0
  69.   SELE primary
  70.   USE &dr.:account
  71.   SET INDEX TO &dr.:account
  72.   GO rec:no
  73.   IF ok
  74.    REPL posted WITH t
  75.   ENDI ok
  76.   CONT
  77.   IF EOF
  78.    STOR f TO accrue1
  79.   ENDI EOF
  80.  ENDD WHILE accrue1
  81.  IF latech > 0
  82.   SET INDEX TO
  83.   GO BOTTOM
  84.   STOR f TO firstup
  85.   DO WHIL .NOT. firstup
  86.    IF $(data,1,1) = 'J'
  87.     STOR VAL($(data,2,3)) TO entryno
  88.     STOR t TO firstup
  89.    ELSE
  90.     SKIP -1
  91.    ENDI
  92.   ENDD WHILE .NOT. firstup
  93.   SET INDEX TO &dr.:account
  94.   STOR entryno + 1 TO entryno
  95.   STOR entryno + 1000 TO entry
  96.   STOR 'J' + $(entry,2,3) TO entry
  97.   APPE BLANK
  98.   REPL date WITH date()
  99.   REPL data with entry + '993020C'+'acc late chgs - all ' + date()+'J'
  100.   REPL amount WITH (latech*-1)
  101.   APPE BLANK
  102.   REPL date WITH date()
  103.   REPL data with entry + '991040D'+'acc late chgs - all ' + date()+'J'
  104.   REPL amount WITH latech
  105.  ENDI latech
  106.  RELE latech, firstup, entryno, entry, rec:no, accrue1, ok, comm
  107.  RELE name, mlate, mamoubt, mtrentd, mtrentt, mtrenty, mtlatec
  108. ENDI accrue1
  109. IF accrue
  110.  SELE SECONDARY
  111.  USE &dr.:TENANT
  112. * if more than 10 properties, will have to adjust this
  113.  STOR 0 TO rent01
  114.  STOR 0 TO rent02
  115.  STOR 0 TO rent03
  116.  STOR 0 TO rent04
  117.  STOR 0 TO rent05
  118.  STOR 0 TO rent06
  119.  STOR 0 TO rent07
  120.  STOR 0 TO rent08
  121.  STOR 0 TO rent09
  122.  STOR 0 TO rent10
  123.  GO TOP
  124.  DO WHIL .NOT. EOF
  125.   IF $(bcode,1,2) = '01'
  126.    STOR rent01 + (trent + taddl) TO rent01
  127.    REPL trentd WITH (trentd + trent + taddl)
  128.   ENDI $(bcode,1,2) = '01'
  129.   IF $(bcode,1,2) = '02'
  130.    STOR rent02 + (trent + taddl) TO rent02
  131.    REPL trentd WITH (trentd + trent + taddl)
  132.   ENDI $(bcode,1,2) = '02'
  133.   IF $(bcode,1,2) = '03'
  134.    STOR rent03 + (trent + taddl) TO rent03
  135.    REPL trentd WITH (trentd + trent + taddl)
  136.   ENDI $(bcode,1,2) = '03'
  137.   IF $(bcode,1,2) = '04'
  138.    STOR rent04 + (trent + taddl) TO rent04
  139.    REPL trentd WITH (trentd + trent + taddl)
  140.   ENDI $(bcode,1,2) = '04'
  141.   IF $(bcode,1,2) = '05'
  142.    STOR rent05 + (trent + taddl) TO rent05
  143.    REPL trentd WITH (trentd + trent + taddl)
  144.   ENDI $(bcode,1,2) = '05'
  145.   IF $(bcode,1,2) = '06'
  146.    STOR rent06 + (trent + taddl) TO rent06
  147.    REPL trentd WITH (trentd + trent + taddl)
  148.   ENDI $(bcode,1,2) = '06'
  149.   IF $(bcode,1,2) = '07'
  150.    STOR rent07 + (trent + taddl) TO rent07
  151.    REPL trentd WITH (trentd + trent + taddl)
  152.   ENDI $(bcode,1,2) = '07'
  153.   IF $(bcode,1,2) = '08'
  154.    STOR rent08 + (trent + taddl) TO rent08
  155.    REPL trentd WITH (trentd + trent + taddl)
  156.   ENDI $(bcode,1,2) = '08'
  157.   IF $(bcode,1,2) = '09'
  158.    STOR rent09 + (trent + taddl) TO rent09
  159.    REPL trentd WITH (trentd + trent + taddl)
  160.   ENDI $(bcode,1,2) = '09'
  161.   IF $(bcode,1,2) = '10'
  162.    STOR rent10 + (trent + taddl) TO rent10
  163.    REPL trentd WITH (trentd + trent + taddl)
  164.   ENDI $(bcode,1,2) = '10'
  165.   SKIP
  166.  ENDD WHILE .NOT. eof
  167.  SELE PRIMARY
  168.  USE &dr.:ACCOUNT
  169.  SET INDEX TO
  170.  GO BOTTOM
  171.  STOR f TO firstup
  172.  DO WHIL .NOT. firstup
  173.   IF $(data,1,1) = 'J'
  174.    STOR VAL($(data,2,3)) TO entryno
  175.    STOR t TO firstup
  176.   ELSE
  177.    SKIP -1
  178.   ENDI
  179.  ENDD WHILE .NOT. firstup
  180.  STOR $(mdate1,7,2) + $(mdate1,1,2) + $(mdate1,4,2) TO mdat1
  181.  IF rent01 > 0
  182.   STOR entryno + 1 TO entryno
  183.   STOR entryno + 1000 TO entryn
  184.   STOR STR(entryn,4) to entry
  185.   STOR 'J' + $(entry,2,3) TO entry
  186.   APPE BLANK
  187.   REPL date WITH mdat1
  188.   REPL data WITH entry+'013020C'+'rent accrual        '+date()+'J'
  189.   REPL amount WITH (rent01*-1)
  190.   APPE BLANK
  191.   REPL date WITH mdat1
  192.   REPL data WITH entry+'011040D'+'rent accrual        '+date()+'J'
  193.   REPL amount WITH rent01
  194.  ENDI rent01 > 0
  195.  IF rent02 > 0
  196.   STOR entryno + 1 TO entryno
  197.   STOR entryno + 1001 TO entryn
  198.   STOR STR(entryn,4) to entry
  199.   STOR 'J' + $(entry,2,3) TO entry
  200.   APPE BLANK
  201.   REPL date WITH mdat1
  202.   REPL data WITH entry+'023020C'+'rent accrual        '+date()+'J'
  203.   REPL amount WITH (rent02*-1)
  204.   APPE BLANK
  205.   REPL date WITH mdat1
  206.   REPL data WITH entry+'021040D'+'rent accrual        '+date()+'J'
  207.   REPL amount WITH rent02
  208.  ENDI rent02 > 0
  209.  IF rent03 > 0
  210.   STOR entryno + 1 TO entryno
  211.   STOR entryno + 1001 TO entryn
  212.   STOR STR(entryn,4) to entry
  213.   STOR 'J' + $(entry,2,3) TO entry
  214.   APPE BLANK
  215.   REPL date WITH mdat1
  216.   REPL data WITH entry+'033020C'+'rent accrual        '+date()+'J'
  217.   REPL amount WITH (rent03*-1)
  218.   APPE BLANK
  219.   REPL date WITH mdat1
  220.   REPL data WITH entry+'031040D'+'rent accrual        '+date()+'J'
  221.   REPL amount WITH rent03
  222.  ENDI rent03 > 0
  223.  IF rent04 > 0
  224.   STOR entryno + 1 TO entryno
  225.   STOR entryno + 1001 TO entryn
  226.   STOR STR(entryn,4) to entry
  227.   STOR 'J' + $(entry,2,3) TO entry
  228.   APPE BLANK
  229.   REPL date WITH mdat1
  230.   REPL data WITH entry+'043020C'+'rent accrual        '+date()+'J'
  231.   REPL amount WITH (rent04*-1)
  232.   APPE BLANK
  233.   REPL date WITH mdat1
  234.   REPL data WITH entry+'041040D'+'rent accrual        '+date()+'J'
  235.   REPL amount WITH rent04
  236.  ENDI rent04 > 0
  237.  IF rent05 > 0
  238.   STOR entryno + 1 TO entryno
  239.   STOR entryno + 1001 TO entryn
  240.   STOR STR(entryn,4) to entry
  241.   STOR 'J' + $(entry,2,3) TO entry
  242.   APPE BLANK
  243.   REPL date WITH mdat1
  244.   REPL data WITH entry+'053020C'+'rent accrual        '+date()+'J'
  245.   REPL amount WITH (rent05*-1)
  246.   APPE BLANK
  247.   REPL date WITH mdat1
  248.   REPL data WITH entry+'051040D'+'rent accrual        '+date()+'J'
  249.   REPL amount WITH rent05
  250.  ENDI rent05 > 0
  251.  IF rent06 > 0
  252.   STOR entryno + 1 TO entryno
  253.   STOR entryno + 1001 TO entryn
  254.   STOR STR(entryn,4) to entry
  255.   STOR 'J' + $(entry,2,3) TO entry
  256.   APPE BLANK
  257.   REPL date WITH mdat1
  258.   REPL data WITH entry+'063020C'+'rent accrual        '+date()+'J'
  259.   REPL amount WITH (rent06*-1)
  260.   APPE BLANK
  261.   REPL date WITH mdat1
  262.   REPL data WITH entry+'061040D'+'rent accrual        '+date()+'J'
  263.   REPL amount WITH rent06
  264.  ENDI rent06 > 0
  265.  IF rent07 > 0
  266.   STOR entryno + 1 TO entryno
  267.   STOR entryno + 1001 TO entryn
  268.   STOR STR(entryn,4) to entry
  269.   STOR 'J' + $(entry,2,3) TO entry
  270.   APPE BLANK
  271.   REPL date WITH mdat1
  272.   REPL data WITH entry+'073020C'+'rent accrual        '+date()+'J'
  273.   REPL amount WITH (rent07*-1)
  274.   APPE BLANK
  275.   REPL date WITH mdat1
  276.   REPL data WITH entry+'071040D'+'rent accrual        '+date()+'J'
  277.   REPL amount WITH rent07
  278.  ENDI rent07 > 0
  279.  IF rent08 > 0
  280.   STOR entryno + 1 TO entryno
  281.   STOR entryno + 1001 TO entryn
  282.   STOR STR(entryn,4) to entry
  283.   STOR 'J' + $(entry,2,3) TO entry
  284.   APPE BLANK
  285.   REPL date WITH mdat1
  286.   REPL data WITH entry+'083020C'+'rent accrual        '+date()+'J'
  287.   REPL amount WITH (rent08*-1)
  288.   APPE BLANK
  289.   REPL date WITH mdat1
  290.   REPL data WITH entry+'081040D'+'rent accrual        '+date()+'J'
  291.   REPL amount WITH rent08
  292.  ENDI rent08 > 0
  293.  IF rent09 > 0
  294.   STOR entryno + 1 TO entryno
  295.   STOR entryno + 1001 TO entryn
  296.   STOR STR(entryn,4) to entry
  297.   STOR 'J' + $(entry,2,3) TO entry
  298.   APPE BLANK
  299.   REPL date WITH mdat1
  300.   REPL data WITH entry+'093020C'+'rent accrual        '+date()+'J'
  301.   REPL amount WITH (rent09*-1)
  302.   APPE BLANK
  303.   REPL date WITH mdat1
  304.   REPL data WITH entry+'091040D'+'rent accrual        '+date()+'J'
  305.   REPL amount WITH rent09
  306.  ENDI rent09 > 0
  307.  IF rent10 > 0
  308.   STOR entryno + 1 TO entryno
  309.   STOR entryno + 1001 TO entryn
  310.   STOR STR(entryn,4) to entry
  311.   STOR 'J' + $(entry,2,3) TO entry
  312.   APPE BLANK
  313.   REPL date WITH mdat1
  314.   REPL data WITH entry+'103020C'+'rent accrual        '+date()+'J'
  315.   REPL amount WITH (rent10*-1)
  316.   APPE BLANK
  317.   REPL date WITH mdat1
  318.   REPL data WITH entry+'101040D'+'rent accrual        '+date()+'J'
  319.   REPL amount WITH rent10
  320.  ENDI rent10 > 0
  321. ENDI accrue
  322. SELE PRIMARY
  323. USE &dr.:account
  324. SET INDEX TO account
  325. STOR 'Y' TO command
  326. ERAS
  327. TEXT
  328.  
  329.           This module updates the accounting files so that statements
  330.           can be prepared.    The steps to do this are to reindex the
  331.           file - and then to set the accrual and statement dates.
  332.  
  333.           If all you want to do is update the rental  records to send
  334.           out monthly rent bills - you need not reindex.  You also do
  335.           not have to reindex if no entries were made since your last
  336.           reindexing.
  337.  
  338.                       SHALL WE REINDEX  ?
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349. ENDT
  350. @ 11,43 GET command PICTURE '!'
  351. READ
  352. IF command = 'Y'
  353.  @ 14,15 SAY 'Reindexing............please be patient'
  354.  @ 15,15 SAY '......................but I will keep you posted'
  355.  @ 16,00
  356.  SET TALK ON
  357.  SET ECHO ON
  358.  INDE ON date + $(data,7,4) + $(data,5,1) TO &dr.:account
  359.  SET TALK OFF
  360.  SET ECHO OFF
  361. ENDI command = 'Y'
  362. RELE all
  363. STOR CHR(PEEK(063)) TO dr
  364. USE &dr.:account
  365. SET INDEX TO &dr.:account
  366. ERAS
  367. STOR t TO account
  368.